package com.august.service;

import com.august.bean.Employees;
import com.august.dao.EmployeesMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : Crazy_August
 * @description :service和dao交互
 * @Time: 2022-02-12   19:51
 */
@Service
public class EmployeesService {

    @Autowired
    EmployeesMapper employeesMapper;

    public List<Employees> getAllEmployeesWithDepartment() {
        return employeesMapper.queryAllEmployeesWithDepartment();
    }

    public void addEmployees(Employees employees) {
        employeesMapper.addEmployees(employees);
    }

    public void updateEmployees(Employees employees) {
        employeesMapper.updateEmployee(employees);
    }

    public void deleteEmployees(Integer id) {
        employeesMapper.deleteEmployeesById(id);
    }


    public Employees getEmployee(Integer empId) {
        return employeesMapper.queryEmployeesById(empId);
    }

    /**
     * 批量删除
     * @param empIds
     */
    public void deleteBatchEmployees(List<Integer>  empIds) {
        employeesMapper.deleteBatchEmployeesById(empIds);
    }
}
